<template>
	<view class="content">
		<view class="section">
			<view class="user-back" :style="{ backgroundImage: 'url(' + backImageUrl + ')' }"></view>
			
			<view class="user-info">
				<view class="user-info-active">
					<view class="user-avatar" :style="{ backgroundImage: 'url(' + avatarUrl + ')' }"></view>
				</view>
				<view class="user-info-nick">
					<view class="user-info-edit" id="userNick">
						<text>{{ userName }}</text>
						<image src="/static/image/icon_11.png" />
					</view>
	                 <text class="user-account">{{ userAccount }}</text>
					<input id="userNickInput" type="text" placeholder="输入昵称" v-if="false" />
				</view>
			</view>
			
			<view class="nav-container">
				
			</view>
			
	
			<view class="user-tool">
				<view class="user-tool-item" @click="clickHref(5)">
					<view class="user-tool-text">
						<image src="/static/image/icon_01.png" />
						<text>已发短信</text>
					</view>
					<text class="icon icon-angle-right"></text>
				</view>
				<view class="user-tool-item" @click="clickHref(6)">
					<view class="user-tool-text">
						<image src="/static/image/icon_12.png" />
						<text>人工传话</text>
					</view>
					<text class="icon icon-angle-right"></text>
				</view>
			</view>
			
			<view class="contact-service">
				<text>联系客服</text>
				客服微信：<text id="kefu">{{ kefu }}</text>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '个人中心',
				userName: 'name',
				userAccount: 'account',
				kefu: '',
				hdata: null,
				backImageUrl: '/static/image/back_03.png',
				avatarUrl: '/static/image/img_00.png'
			}
		},
		onLoad() {
		  uni.setNavigationBarTitle({
			title: '个人中心', 
		  });
		},
		methods: {
			
			async getKefuInfo() {
			
				setTimeout(() => {
					// 模拟返回数据
					this.kefu = 'kefu123';
				}, 500);
				
			},
			
	
			clickHref(type) {
				let url = "";
				switch(type) {
					case 0:
						url = "/pages/test/test";
						break;
					case 1:
						url = "/pages/test/test";
						break;
					default:
						break;
				}
				
				if (url) {
					uni.navigateTo({
						url: url
					});
				}
			}
		}
	}
</script>

<style>
	.content {
		background-color: #f6f6f6;
		min-height: 100vh;
		padding-bottom: 120rpx;
	}
	
	.footer {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		display: flex;
		height: 120rpx;
		background: white;
		border-top: 1px solid #eee;
		z-index: 999;
	}
	
	.footer-item {
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		font-size: 12px;
		color: #4F4F4F;
	}
	
	.footer-item image {
		width: 48rpx;
		height: 48rpx;
		margin-bottom: 8rpx;
	}
	
	.footer-item.show {
		color: #007AFF;
	}
	
	.section {
		padding-bottom: 120rpx;
	}
	
	.user-back {
		height: 300rpx;
		background-size: cover;
		background-position: center;
	}
	
	.user-info {
		padding: 40rpx 0rpx 20rpx 20rpx;
		position: relative;
		display: flex;
	}
	
	.user-info-active {
		float: left;
	}
	
	.user-avatar {
		width: 120rpx;
		height: 120rpx;
		border-radius: 50%;
		background-size: cover;
		background-position: center;
	}
	
	
	.user-info-edit {
		display: flex;
		align-items: center;
		margin-bottom: 10rpx;
	}
	
	.user-info-edit text {
		font-size: 16px;
		font-weight: bold;
	}
	
	.user-info-edit image {
		width: 32rpx;
		height: 32rpx;
		margin: 0 20rpx;
	}
	
	
	.nav-container {
		
	}
	
	.user-tool {
		background: white;
		margin: 20rpx 0;
	}
	
	.user-tool-item {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 30rpx 40rpx;
		border-bottom: 1px solid #eee;
	}
	
	.user-tool-item:last-child {
		border-bottom: none;
	}
	
	.user-tool-text {
		display: flex;
		align-items: center;
	}
	
	.user-tool-text image {
		width: 40rpx;
		height: 40rpx;
		margin-right: 20rpx;
	}
	
	.contact-service {
		text-align: center;
		padding: 40rpx;
		color: #666;
		font-size: 14px;
	}
	
	.contact-service text {
		color: #007AFF;
	}
	
	.sms_price {
		display: inline-block;
		padding: 20rpx;
		width: 23%;
		border: 1px solid #000;
		box-shadow: 8rpx 8rpx 16rpx #8787878f;
		border-radius: 40rpx;
		margin: 10rpx;
		text-align: center;
	}
	
	.nav a {
		width: 25%;
		height: 140rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		color: #4F4F4F;
	}
	
	.nav a b {
		color: #000000;
		font-size: 16px;
	}



	.user-back {
    width: 100%;
    padding-top: 91%;
    background-size: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.user-back img {
    width: 200rpx;
    position: absolute;
    right: 30rpx;
    top: 160rpx;
}



.user-info-active {
    position: relative;
    width: 120rpx;
    height: 120rpx;
    background: white;
    border-radius: 50%;
    display: inline-block;
    overflow: hidden;
    box-shadow: 0rpx 6rpx 30rpx 0rpx rgba(189, 191, 191, 0.3);
}

.user-info-active span {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.user-info-nick {
    font-size: 16px;
    font-weight: bold;
    color: #4286C8;
	padding-left: 40rpx;
}

.user-info-nick img {
    width: 32rpx;
    height: 32rpx;
    vertical-align: middle;
    margin-left: 10rpx;
    margin-bottom: 6rpx;
}

.user-info-nick input {
    width: 400rpx;
    text-align: center;
    border: none;
    outline: none;
    height: 80rpx;
    font-size: 16px;
    padding: 0 30rpx;
    color: #333;
    background: transparent;
}

.user-info-nick input::placeholder {
    font-size: 16px;
}

.user-tool {
    padding: 0;
    margin: 40rpx 0 0;
    list-style: none;
}

.user-tool a {
    display: flex;
    padding: 0 30rpx;
    height: 90rpx;
    align-items: center;
    justify-content: space-between;
}

.user-tool i {
    font-size: 20px;
    color: #AFAFAF;
}

.user-tool-text {
    font-weight: bold;
    color: #333333;
}

.user-tool-text img {
    width: 36rpx;
    height: 36rpx;
    vertical-align: middle;
    margin-right: 20rpx;
    margin-bottom: 6rpx;
}
</style>